<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax Get 请求</title>
    <script>
        function MyRequest() {
            const xhr = new XMLHttpRequest();
            xhr.open('GET', 'http://localhost:8000/server?a=100&b=200&c=300');
            xhr.send();
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status >= 200 && xhr.status <= 300) {
                        console.log(xhr.status)
                        console.log(xhr.statusText)
                        console.log(xhr.getAllResponseHeaders())
                        console.log(xhr.response)

                        document.getElementById('result').innerHTML = xhr.response
                    }
                }
            }
        }
    </script>
</head>
<body>
<button style="display: block" onclick="MyRequest()">点击发送请求</button>
<br>
<div id="result"></div>
</body>
</html>
